import { FC, useEffect } from 'react';
import styles from './index.module.scss';
import { useNavigate } from 'react-router-dom';
import { Button, Typography } from 'antd';
import { MANAGE_INDEX_PATHNAME } from '../../router';
const Home: FC = () => {
  const nav = useNavigate();
  const { Title, Paragraph } = Typography;
  useEffect(() => {
    fetch('/api/test')
      .then((res) => res.json())
      .then((res) => console.log(res));
  }, []);
  return (
    <div className={styles.container}>
      <div className={styles.info}>
        <Title>问卷调查 | 在线投票</Title>
        <Paragraph>已累计创建 300 份，发布问卷 90 份，收到答卷 980 份</Paragraph>
        <div>
          <Button type="primary" onClick={() => nav(MANAGE_INDEX_PATHNAME)}>
            开始使用
          </Button>
        </div>
      </div>
    </div>
  );
};
export default Home;
